import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: 'login'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login/LoginViews.vue')
    },
    {
      path: '/dashboardView',
      name: 'dashboardView',
      component: () => import('../views/dashboard/dashboardView.vue'),
      meta: {
        title: 'Dashboard'
      },
      children: [
        {
          path: '/dashboardView/home',
          redirect: '/home'
        },
        {
          path: '/home',
          name: 'home',
          component: () => import('../views/home/homeView.vue'),
          meta: {
            title: '首页'
          }
        },
        {
          path: '/structure',
          name: 'structure',
          component: () => import('../views/structure/structureView.vue'),
          meta: {
            title: '组织'
          }
        },
        {
          path: '/character',
          name: 'character',
          component: () => import('../views/character/characterView.vue'),
          meta: {
            title: '角色'
          }
        },
        {
          path: '/staffView',
          name: 'staffView',
          component: () => import('../views/staff/staffView.vue'),
          meta: {
            title: '员工'
          }
        },
        {
          path: '/authority',
          name: 'authority',
          component: () => import('../views/authority/authorityView.vue'),
          meta: {
            title: '权限'
          }
        },
        {
          path: '/attendanceView',
          name: 'attendanceView',
          component: () => import('../views/attendance/attendanceView.vue'),
          meta: {
            title: '考勤'
          }
        },
        {
          path: '/approvalView',
          name: 'approvalView',
          component: () => import('../views/approvai/approvalView.vue'),
          meta: {
            title: '审批'
          }
        },
        {
          path: '/wageView',
          name: 'wageView',
          component: () => import('../views/wage/wageView.vue'),
          meta: {
            title: '工资'
          }
        },
        {
          path: '/salary',
          name: 'salary',
          component: () => import('../views/salary/salaryView.vue'),
          meta: {
            title: '薪资'
          }
        },
        {
          path: '/leave',
          name: 'leave',
          component: () => import('../views/leave/leaveView.vue'),
          meta: {
            title: '社保'
          }
        }
      ]
    }
  ]
})
export default router
